<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>HSSFConditionalFormatting (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="HSSFConditionalFormatting (POI API Documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/HSSFConditionalFormatting.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFComment.html" title="class in org.apache.poi.hssf.usermodel"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html" target="_top">FRAMES</a></li>
<li><a href="HSSFConditionalFormatting.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.hssf.usermodel</p>
<h2 title="Class HSSFConditionalFormatting" class="title">Class HSSFConditionalFormatting</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.poi.hssf.usermodel.HSSFConditionalFormatting</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></dd>
</dl>
<hr>
<br>
<pre>public final class <strong>HSSFConditionalFormatting</strong>
extends java.lang.Object
implements <a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></pre>
<div class="block">HSSFConditionalFormatting class encapsulates all settings of Conditional Formatting. 
 
 The class can be used 
 
 <UL>
 <LI>
 to make a copy HSSFConditionalFormatting settings.
 </LI>
  
 
 For example:
 <PRE>
 HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index);
 newSheet.addConditionalFormatting(cf);
 </PRE>
 
  <LI>
  or to modify existing Conditional Formatting settings (formatting regions and/or rules).
  </LI>
  </UL>
 
 Use <a href="../../../../../org/apache/poi/hssf/usermodel/HSSFSheet.html#getSheetConditionalFormatting()"><code>HSSFSheet.getSheetConditionalFormatting()</code></a> to get access to an instance of this class.
 <P>
 To create a new Conditional Formatting set use the following approach:
 
 <PRE>
 
 // Define a Conditional Formatting rule, which triggers formatting
 // when cell's value is greater or equal than 100.0 and
 // applies patternFormatting defined below.
 HSSFConditionalFormattingRule rule = sheet.createConditionalFormattingRule(
     ComparisonOperator.GE, 
     "100.0", // 1st formula 
     null     // 2nd formula is not used for comparison operator GE
 );
 
 // Create pattern with red background
 HSSFPatternFormatting patternFmt = rule.cretePatternFormatting();
 patternFormatting.setFillBackgroundColor(HSSFColor.RED.index);
 
 // Define a region containing first column
 Region [] regions =
 {
     new Region(1,(short)1,-1,(short)1)
 };
     
 // Apply Conditional Formatting rule defined above to the regions  
 sheet.addConditionalFormatting(regions, rule);
 </PRE></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#addRule(org.apache.poi.ss.usermodel.ConditionalFormattingRule)">addRule</a></strong>(<a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormattingRule.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormattingRule</a>&nbsp;cfRule)</code>
<div class="block">Add a Conditional Formatting rule.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#addRule(org.apache.poi.hssf.usermodel.HSSFConditionalFormattingRule)">addRule</a></strong>(<a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel">HSSFConditionalFormattingRule</a>&nbsp;cfRule)</code>
<div class="block">add a Conditional Formatting rule.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/poi/ss/util/CellRangeAddress.html" title="class in org.apache.poi.ss.util">CellRangeAddress</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#getFormattingRanges()">getFormattingRanges</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/poi/ss/util/Region.html" title="class in org.apache.poi.ss.util">Region</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#getFormattingRegions()">getFormattingRegions</a></strong>()</code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>(Aug-2008) use <a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#getFormattingRanges()"><code>getFormattingRanges()</code></a></i></div>
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#getNumberOfRules()">getNumberOfRules</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel">HSSFConditionalFormattingRule</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#getRule(int)">getRule</a></strong>(int&nbsp;idx)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#setRule(int, org.apache.poi.ss.usermodel.ConditionalFormattingRule)">setRule</a></strong>(int&nbsp;idx,
       <a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormattingRule.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormattingRule</a>&nbsp;cfRule)</code>
<div class="block">Replaces an existing Conditional Formatting rule at position idx.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#setRule(int, org.apache.poi.hssf.usermodel.HSSFConditionalFormattingRule)">setRule</a></strong>(int&nbsp;idx,
       <a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel">HSSFConditionalFormattingRule</a>&nbsp;cfRule)</code>
<div class="block">Replaces an existing Conditional Formatting rule at position idx.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#toString()">toString</a></strong>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getFormattingRegions()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFormattingRegions</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/poi/ss/util/Region.html" title="class in org.apache.poi.ss.util">Region</a>[]&nbsp;getFormattingRegions()</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>(Aug-2008) use <a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html#getFormattingRanges()"><code>getFormattingRanges()</code></a></i></div>
</li>
</ul>
<a name="getFormattingRanges()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFormattingRanges</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/poi/ss/util/CellRangeAddress.html" title="class in org.apache.poi.ss.util">CellRangeAddress</a>[]&nbsp;getFormattingRanges()</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#getFormattingRanges()">getFormattingRanges</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>array of <tt>CellRangeAddress</tt>s. never <code>null</code></dd></dl>
</li>
</ul>
<a name="setRule(int, org.apache.poi.hssf.usermodel.HSSFConditionalFormattingRule)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRule</h4>
<pre>public&nbsp;void&nbsp;setRule(int&nbsp;idx,
           <a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel">HSSFConditionalFormattingRule</a>&nbsp;cfRule)</pre>
<div class="block">Replaces an existing Conditional Formatting rule at position idx. 
 Excel allows to create up to 3 Conditional Formatting rules.
 This method can be useful to modify existing  Conditional Formatting rules.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>idx</code> - position of the rule. Should be between 0 and 2.</dd><dd><code>cfRule</code> - - Conditional Formatting rule</dd></dl>
</li>
</ul>
<a name="setRule(int, org.apache.poi.ss.usermodel.ConditionalFormattingRule)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRule</h4>
<pre>public&nbsp;void&nbsp;setRule(int&nbsp;idx,
           <a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormattingRule.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormattingRule</a>&nbsp;cfRule)</pre>
<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#setRule(int, org.apache.poi.ss.usermodel.ConditionalFormattingRule)">ConditionalFormatting</a></code></strong></div>
<div class="block">Replaces an existing Conditional Formatting rule at position idx.
 Excel allows to create up to 3 Conditional Formatting rules.
 This method can be useful to modify existing  Conditional Formatting rules.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#setRule(int, org.apache.poi.ss.usermodel.ConditionalFormattingRule)">setRule</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>idx</code> - position of the rule. Should be between 0 and 2.</dd><dd><code>cfRule</code> - - Conditional Formatting rule</dd></dl>
</li>
</ul>
<a name="addRule(org.apache.poi.hssf.usermodel.HSSFConditionalFormattingRule)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addRule</h4>
<pre>public&nbsp;void&nbsp;addRule(<a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel">HSSFConditionalFormattingRule</a>&nbsp;cfRule)</pre>
<div class="block">add a Conditional Formatting rule. 
 Excel allows to create up to 3 Conditional Formatting rules.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cfRule</code> - - Conditional Formatting rule</dd></dl>
</li>
</ul>
<a name="addRule(org.apache.poi.ss.usermodel.ConditionalFormattingRule)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addRule</h4>
<pre>public&nbsp;void&nbsp;addRule(<a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormattingRule.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormattingRule</a>&nbsp;cfRule)</pre>
<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#addRule(org.apache.poi.ss.usermodel.ConditionalFormattingRule)">ConditionalFormatting</a></code></strong></div>
<div class="block">Add a Conditional Formatting rule.
 Excel allows to create up to 3 Conditional Formatting rules.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#addRule(org.apache.poi.ss.usermodel.ConditionalFormattingRule)">addRule</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>cfRule</code> - - Conditional Formatting rule</dd></dl>
</li>
</ul>
<a name="getRule(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRule</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel">HSSFConditionalFormattingRule</a>&nbsp;getRule(int&nbsp;idx)</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#getRule(int)">getRule</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>the Conditional Formatting rule at position idx.</dd></dl>
</li>
</ul>
<a name="getNumberOfRules()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumberOfRules</h4>
<pre>public&nbsp;int&nbsp;getNumberOfRules()</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html#getNumberOfRules()">getNumberOfRules</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/ConditionalFormatting.html" title="interface in org.apache.poi.ss.usermodel">ConditionalFormatting</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>number of Conditional Formatting rules.</dd></dl>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/HSSFConditionalFormatting.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFComment.html" title="class in org.apache.poi.hssf.usermodel"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.html" title="class in org.apache.poi.hssf.usermodel"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.html" target="_top">FRAMES</a></li>
<li><a href="HSSFConditionalFormatting.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li>CONSTR&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            </small></p>
</body>
</html>
